# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
pkgname=antlr4
_shortname=${pkgname:0:-1}
pkgver=4.7.1
pkgrel=1
pkgdesc='Parser generator for reading, processing, executing, or translating structured text or binary files'
arch=('any')
url='http://www.antlr.org/index.html'
license=('BSD')
depends=('java-environment>=6')
provides=("antlr=${pkgver}")
source=(http://www.antlr.org/download/${_shortname}-${pkgver}-complete.jar
        https://raw.githubusercontent.com/${_shortname}/${pkgname}/master/LICENSE.txt
        bin_antlr4
        bin_grun)
noextract=("${_shortname}-${pkgver}-complete.jar")
sha256sums=('f41dce7441d523baf9769cb7756a00f27a4b67e55aacab44525541f62d7f6688'
            'b1b379fcaf3219593a4c433feb1b35c780bed23fafaae440b1ae2771a9521e3a'
            '345697e77b7191e2afe70b223f205a8a7fd18a655e6865f503a764583d9a3dcc'
            '81e1536e011762287a095e969784a9f2fbbcc62374ab5fb83e19e01ade20b454')

package() {
  cd "${srcdir}"
  install -D ${_shortname}-${pkgver}-complete.jar \
             "${pkgdir}"/usr/share/java/${_shortname}-${pkgver}-complete.jar
  ln -s antlr-${pkgver}-complete.jar "${pkgdir}"/usr/share/java/antlr-complete.jar
  install -D bin_antlr4 "${pkgdir}"/usr/bin/antlr4
  install -D bin_grun   "${pkgdir}"/usr/bin/grun
  install -D LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.txt
}
